import request from '@/utils/request'

export function login(data) {
  return request({
    url: '/v1/account/login',
    method: 'post',
    data
  })
}

export function registry(data) {
  return request({
    url: '/v1/account/registry',
    method: 'post',
    data
  })
}

export function accountList(data) {
  return request({
    url: '/v1/account/query',
    method: 'post',
    data
  })
}

export function accountDelete(data) {
  return request({
    url: '/v1/account/delete',
    method: 'post',
    data
  })
}

export function accountUpdate(data) {
  return request({
    url: '/v1/account/update',
    method: 'post',
    data
  })
}

export function passwordUpdate(data) {
  return request({
    url: '/v1/account/passwordUpdate',
    method: 'post',
    data
  })
}

export function checkUserName(data) {
  return request({
    url: '/v1/account/checkUserName',
    method: 'post',
    data
  })
}

export function getInfo(token) {
  return request({
    url: '/v1/vue-element-admin/user/info',
    method: 'get',
    params: { token }
  })
}

export function logout(data) {
  return request({
    url: '/v1/account/logout',
    method: 'post',
    data
  })
}
